﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ICM_Purchase_Request_Bidder.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Add_Form.ICM_Purchase_Request_Bidder" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<%@ Register TagPrefix="custom" Namespace="KPIS.Customs.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
    <LINK REL="StyleSheet" HREF="../../Styles/StyleSheet.css" TYPE="text/css">  
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" >
        </asp:ScriptManager>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript" src="../../Scripts/Common.js"></script>
            <script type="text/javascript">
                var detail = 0;
                var item = 0;
                var file = 0;
                
                function SeqClick(seq) {
                    var hiddenElement = document.getElementById("<%= hdQuotationSeq.ClientID %>");
                    hiddenElement.value = seq;
                    $find("<%= RadManager1.ClientID %>").ajaxRequest(seq);
                }
                
                function onTextChangeGeneral(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }

                var cancelDropDownClosing = false;

                function StopPropagation(e) {
                    e.cancelBubble = true;
                    if (e.stopPropagation) {
                        e.stopPropagation();
                    }
                }

                function ChangeTab(value, page_index) {
                    Page_ClientValidate();
                    if (Page_IsValid) {
                        if (value == "Item") {
                            item = 1;
                        }
                        if (value == "File") {
                            file = 1;
                        }
                        var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
                        var pageView = $find("<%= RadMultiPage1.ClientID %>");
                        var tab = tabStrip.findTabByValue(value);
                        var pageViewIndex = page_index;
                        tab.set_selected(true);
                        pageView.get_pageViews().getPageView(pageViewIndex).set_selected(true);
                    }
                }
                
                function GetRadWindow() {
                    var oWindow = null;
                    if (window.radWindow)
                        oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog      
                    else if (window.frameElement.radWindow)
                        oWindow = window.frameElement.radWindow; //IE (and Moz as well)      
                    return oWindow;
                }

                function CloseWindow() {
                    GetRadWindow().Close();
                }      
                
                function getSourceFile() {
                    extArray = new Array(".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".rtf");
                    allowSubmit = false;
                    var file = document.getElementById('<%= attachment.ClientID %>');
                    var source_file = document.getElementById('<%= hdSourceFile.ClientID %>');
                    var div_part = document.getElementById('<%= uploadFile_div.ClientID %>');
                    value = file.value;
                    if (value.length == 0) {
                        return;
                    }
                    while (value.indexOf("\\") != -1) {
                        value = value.slice(value.indexOf("\\") + 1);
                    }
                    ext = value.slice(value.indexOf(".")).toLowerCase();
                    for (var i = 0; i < extArray.length; i++) {
                        if (ext.indexOf(extArray[i]) >= 0) {
                            allowSubmit = true; break;
                        }
                    }
                    if (allowSubmit) {
                        source_file.value = file.value;
                    }
                    else {
                        alert("ไฟล์เอกสารใช้ได้เฉพาะนามสกุล .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf, .rtf เท่านั้น");
                        div_part.innerHTML = div_part.innerHTML;
                    }
                }

                function OnClientTabSelecting(sender, eventArgs) {
                    var value = eventArgs.get_tab().get_value();
                    if ((value == "Item" && item == 0)
                       || (value == "File" && file == 0)
                    ) {
                        eventArgs.set_cancel(true);
                    }
                }

                function CalculateVat() {
                    var lblVatTypeName = document.getElementById("<%=lblVatTypeName.ClientID%>"); /*ฐานภาษี*/
                    switch (lblVatTypeName.innerHTML) {
                        case 'แยกภาษี (ยังไม่รวม)':
                            CalculateSeparateVat();
                            addCommasAllLable();
                            break;
                        case 'รวมภาษี':
                            CalculateAddedVat();
                            addCommasAllLable();
                            break;
                        case 'ยกเว้นภาษี':
                            CalculateExceptVat();
                            addCommasAllLable();
                            break;
                        default:
                            ResetLable();
                    }

                }
                
                function cbSellerOnSelectedIndexChanged(sender, eventArgs) {
                    var value = sender.get_value().toString().split(":");
                    var cbVatType = $find("<%= cbVatType.ClientID %>");
                    var item = cbVatType.findItemByValue(value[1]);
                    item.select();
                }

                function cbVatTypeOnSelectedIndexChanged(sender, eventArgs) {
                    var default_vat = document.getElementById('<%= hdDefaultVat.ClientID %>');
                    var txtVatPercent = $find("<%= txtVatPercent.ClientID %>");
                    if (sender.get_text() == 'ยกเว้นภาษี') {
                        txtVatPercent.set_value('0');
                        txtVatPercent.disable();
                    } 
                    else 
                    {
                        txtVatPercent.set_value(default_vat.value);
                        txtVatPercent.enable();
                    }
                }

                function cbItemOnSelectedIndexChanged(sender, eventArgs) {
                    var item = eventArgs.get_item();
                    var tmpStrng = item.get_value().split(':');
                    var txtItemQty = $find("<%= txtItemQty.ClientID %>"); /*จำนวน*/
                    var txtItemPrice = $find("<%= txtItemPrice.ClientID %>"); /*ราคาต่อหน่วย*/
                    var lblUnit = document.getElementById("<%=lblUnit.ClientID%>");
                    lblUnit.innerHTML = tmpStrng[2];
                    txtItemQty.set_value(tmpStrng[3]);
                    txtItemPrice.set_value(tmpStrng[4]);
                    CalculateVat();
                }

                function CalculateSeparateVat() { /*แยกภาษี (ยังไม่รวม)*/
                
                    var txtItemQty = $find("<%= txtItemQty.ClientID %>"); /*จำนวน*/
                    var txtItemPrice = $find("<%= txtItemPrice.ClientID %>"); /*ราคาต่อหน่วย*/
                    var lblExcludeAmount = document.getElementById("<%=lblExcludeAmount.ClientID%>"); /*ราคาไม่รวมภาษี*/
                    var lblVatPercent = document.getElementById("<%=lblVatPercent.ClientID%>"); /*ภาษี*/
                    var lblVatAmount = document.getElementById("<%=lblVatAmount.ClientID%>"); /*ภาษีมูลค่าเพิ่ม*/
                    var txtDiscountPercent = $find("<%= txtDiscountPercent.ClientID %>"); /*อัตราส่วนลด*/
                    var lblDiscountPercentAmount = document.getElementById("<%=lblDiscountPercentAmount.ClientID%>"); /*คิดเป็นมูลค่า*/
                    var txtExtraDiscount = $find("<%= txtExtraDiscount.ClientID %>"); /*ส่วนลดพิเศษ*/
                    var lblTotalDiscountAmount = document.getElementById("<%=lblTotalDiscountAmount.ClientID%>"); /*มูลค่าส่วนลดรวม*/
                    var lblTotalAmount = document.getElementById("<%=lblTotalAmount.ClientID%>"); /*ราคาสุทธิ*/
                    var hdExcludeVatAmount = document.getElementById('<%= hdExcludeVatAmount.ClientID %>');
                    var hdVatAmount = document.getElementById('<%= hdVatAmount.ClientID %>');
                    var hdNetAmount = document.getElementById('<%= hdNetAmount.ClientID %>');
                    var TmpAns = document.getElementById('<%= hdDefaultVat.ClientID %>');
                    
                    /*txtItemQty.SetValue('333');
                    alert(txtItemQty.get_value());
                    lblVatTypeName.innerHTML = '222';
                    alert(lblVatTypeName.innerHTML);*/

                    if (txtItemQty.get_value() == '' || txtItemPrice.get_value() == '') {
                        ResetLable();
                        return;
                    }
                    
                    /*ราคาไม่รวมภาษี*/
                    var ItemQty = parseFloat(txtItemQty.get_value());
                    var ItemPrice = parseFloat(txtItemPrice.get_value());
                    lblExcludeAmount.innerHTML = Math.round((ItemQty * ItemPrice) * 100) / 100;

                    /*ภาษีมูลค่าเพิ่ม*/
                    var VatPercent = parseFloat(lblVatPercent.innerHTML);
                    if (lblVatPercent.innerHTML == '')
                        VatPercent = 0;
                    TmpAns = (ItemQty * ItemPrice) * (VatPercent / 100);
                    lblVatAmount.innerHTML = Math.round(TmpAns * 100) / 100;
                    
                    /*คิดเป็นมูลค่า*/
                    var DiscountPercent = parseFloat(txtDiscountPercent.get_value());
                    if (txtDiscountPercent.get_value() == '')
                        DiscountPercent = 0;
                    TmpAns = (parseFloat(lblExcludeAmount.innerHTML) + parseFloat(lblVatAmount.innerHTML)) * (DiscountPercent / 100);
                    lblDiscountPercentAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*มูลค่าส่วนลด*/
                    var DiscountPercentAmount = parseFloat(lblDiscountPercentAmount.innerHTML);
                    var ExtraDiscount = parseFloat(txtExtraDiscount.get_value());
                    if (lblDiscountPercentAmount.innerHTML == '')
                        DiscountPercentAmount = 0;
                    if (txtExtraDiscount.get_value() == '')
                        ExtraDiscount = 0;
                    TmpAns = DiscountPercentAmount + ExtraDiscount;
                    lblTotalDiscountAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*ราคาสุทธิ*/
                    TmpAns = (parseFloat(lblExcludeAmount.innerHTML) + parseFloat(lblVatAmount.innerHTML)) - parseFloat(lblTotalDiscountAmount.innerHTML);
                    lblTotalAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    hdExcludeVatAmount.value = lblExcludeAmount.innerHTML;
                    hdVatAmount.value = lblVatAmount.innerHTML;
                    hdNetAmount.value = lblTotalAmount.innerHTML;
                }
                
                function CalculateAddedVat() { /*รวมภาษี*/
                   
                    var txtItemQty = $find("<%= txtItemQty.ClientID %>"); /*จำนวน*/
                    var txtItemPrice = $find("<%= txtItemPrice.ClientID %>"); /*ราคาต่อหน่วย*/
                    var lblExcludeAmount = document.getElementById("<%=lblExcludeAmount.ClientID%>"); /*ราคาไม่รวมภาษี*/
                    var lblVatPercent = document.getElementById("<%=lblVatPercent.ClientID%>"); /*ภาษี*/
                    var lblVatAmount = document.getElementById("<%=lblVatAmount.ClientID%>"); /*ภาษีมูลค่าเพิ่ม*/
                    var txtDiscountPercent = $find("<%= txtDiscountPercent.ClientID %>"); /*อัตราส่วนลด*/
                    var lblDiscountPercentAmount = document.getElementById("<%=lblDiscountPercentAmount.ClientID%>"); /*คิดเป็นมูลค่า*/
                    var txtExtraDiscount = $find("<%= txtExtraDiscount.ClientID %>"); /*ส่วนลดพิเศษ*/
                    var lblTotalDiscountAmount = document.getElementById("<%=lblTotalDiscountAmount.ClientID%>"); /*มูลค่าส่วนลดรวม*/
                    var lblTotalAmount = document.getElementById("<%=lblTotalAmount.ClientID%>"); /*ราคาสุทธิ*/
                    var hdExcludeVatAmount = document.getElementById('<%= hdExcludeVatAmount.ClientID %>');
                    var hdVatAmount = document.getElementById('<%= hdVatAmount.ClientID %>');
                    var hdNetAmount = document.getElementById('<%= hdNetAmount.ClientID %>');
                    var TmpAns;

                    /*txtItemQty.SetValue('333');
                    alert(txtItemQty.get_value());
                    lblVatTypeName.innerHTML = '222';
                    alert(lblVatTypeName.innerHTML);*/

                    if (txtItemQty.get_value() == '' || txtItemPrice.get_value() == '') {
                        ResetLable();
                        return;
                    }

                    /*ราคาไม่รวมภาษี*/
                    var ItemQty = parseFloat(txtItemQty.get_value());
                    var ItemPrice = parseFloat(txtItemPrice.get_value());
                    var VatPercent = parseFloat(lblVatPercent.innerHTML);
                    TmpAns = ((ItemQty * ItemPrice) / (100 + VatPercent)) * 100;
                    lblExcludeAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*ภาษีมูลค่าเพิ่ม*/
                    var ExcludeAmount = parseFloat(lblExcludeAmount.innerHTML);
                    TmpAns = (ItemQty * ItemPrice) - ExcludeAmount;
                    lblVatAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*คิดเป็นมูลค่า*/
                    var DiscountPercent = parseFloat(txtDiscountPercent.get_value());
                    if (txtDiscountPercent.get_value() == '')
                        DiscountPercent = 0;
                    TmpAns = (parseFloat(lblExcludeAmount.innerHTML) + parseFloat(lblVatAmount.innerHTML)) * (DiscountPercent / 100);
                    lblDiscountPercentAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*มูลค่าส่วนลด*/
                    var DiscountPercentAmount = parseFloat(lblDiscountPercentAmount.innerHTML);
                    var ExtraDiscount = parseFloat(txtExtraDiscount.get_value());
                    if (lblDiscountPercentAmount.innerHTML == '')
                        DiscountPercentAmount = 0;
                    if (txtExtraDiscount.get_value() == '')
                        ExtraDiscount = 0;
                    TmpAns = DiscountPercentAmount + ExtraDiscount;
                    lblTotalDiscountAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*ราคาสุทธิ*/
                    TmpAns = (parseFloat(lblExcludeAmount.innerHTML) + parseFloat(lblVatAmount.innerHTML)) - parseFloat(lblTotalDiscountAmount.innerHTML);
                    lblTotalAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    hdExcludeVatAmount.value = lblExcludeAmount.innerHTML;
                    hdVatAmount.value = lblVatAmount.innerHTML;
                    hdNetAmount.value = lblTotalAmount.innerHTML;
                }
                
                function CalculateExceptVat() { /*ยกเว้นภาษี*/

                    var txtItemQty = $find("<%= txtItemQty.ClientID %>"); /*จำนวน*/
                    var txtItemPrice = $find("<%= txtItemPrice.ClientID %>"); /*ราคาต่อหน่วย*/
                    var lblExcludeAmount = document.getElementById("<%=lblExcludeAmount.ClientID%>"); /*ราคาไม่รวมภาษี*/
                    var lblVatPercent = document.getElementById("<%=lblVatPercent.ClientID%>"); /*ภาษี*/
                    var lblVatAmount = document.getElementById("<%=lblVatAmount.ClientID%>"); /*ภาษีมูลค่าเพิ่ม*/
                    var txtDiscountPercent = $find("<%= txtDiscountPercent.ClientID %>"); /*อัตราส่วนลด*/
                    var lblDiscountPercentAmount = document.getElementById("<%=lblDiscountPercentAmount.ClientID%>"); /*คิดเป็นมูลค่า*/
                    var txtExtraDiscount = $find("<%= txtExtraDiscount.ClientID %>"); /*ส่วนลดพิเศษ*/
                    var lblTotalDiscountAmount = document.getElementById("<%=lblTotalDiscountAmount.ClientID%>"); /*มูลค่าส่วนลดรวม*/
                    var lblTotalAmount = document.getElementById("<%=lblTotalAmount.ClientID%>"); /*ราคาสุทธิ*/
                    var hdExcludeVatAmount = document.getElementById('<%= hdExcludeVatAmount.ClientID %>');
                    var hdVatAmount = document.getElementById('<%= hdVatAmount.ClientID %>');
                    var hdNetAmount = document.getElementById('<%= hdNetAmount.ClientID %>');
                    var TmpAns;

                    /*txtItemQty.SetValue('333');
                    alert(txtItemQty.get_value());
                    lblVatTypeName.innerHTML = '222';
                    alert(lblVatTypeName.innerHTML);*/

                    if (txtItemQty.get_value() == '' || txtItemPrice.get_value() == '') {
                        ResetLable();
                        return;
                    }

                    /*ราคาไม่รวมภาษี*/
                    var ItemQty = parseFloat(txtItemQty.get_value());
                    var ItemPrice = parseFloat(txtItemPrice.get_value());
                    lblExcludeAmount.innerHTML = Math.round((ItemQty * ItemPrice) * 100) / 100;

                    /*ภาษีมูลค่าเพิ่ม*/
                    var VatPercent = 0;
                    lblVatAmount.innerHTML = 0;

                    /*คิดเป็นมูลค่า*/
                    var DiscountPercent = parseFloat(txtDiscountPercent.get_value());
                    if (txtDiscountPercent.get_value() == '')
                        DiscountPercent = 0;
                    TmpAns = (parseFloat(lblExcludeAmount.innerHTML) + parseFloat(lblVatAmount.innerHTML)) * (DiscountPercent / 100);
                    lblDiscountPercentAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*มูลค่าส่วนลด*/
                    var DiscountPercentAmount = parseFloat(lblDiscountPercentAmount.innerHTML);
                    var ExtraDiscount = parseFloat(txtExtraDiscount.get_value());
                    if (lblDiscountPercentAmount.innerHTML == '')
                        DiscountPercentAmount = 0;
                    if (txtExtraDiscount.get_value() == '')
                        ExtraDiscount = 0;
                    TmpAns = DiscountPercentAmount + ExtraDiscount;
                    lblTotalDiscountAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    /*ราคาสุทธิ*/
                    TmpAns = (parseFloat(lblExcludeAmount.innerHTML) + parseFloat(lblVatAmount.innerHTML)) - parseFloat(lblTotalDiscountAmount.innerHTML);
                    lblTotalAmount.innerHTML = Math.round(TmpAns * 100) / 100;

                    hdExcludeVatAmount.value = lblExcludeAmount.innerHTML;
                    hdVatAmount.value = lblVatAmount.innerHTML;
                    hdNetAmount.value = lblTotalAmount.innerHTML;
                }

                function ResetLable() {
                    document.getElementById("<%=lblExcludeAmount.ClientID%>").innerHTML = ''; /*ราคาไม่รวมภาษี*/
                    document.getElementById("<%=lblVatAmount.ClientID%>").innerHTML = ''; /*ภาษีมูลค่าเพิ่ม*/
                    document.getElementById("<%=lblDiscountPercentAmount.ClientID%>").innerHTML = ''; /*คิดเป็นมูลค่า*/
                    document.getElementById("<%=lblTotalDiscountAmount.ClientID%>").innerHTML = ''; /*มูลค่าส่วนลดรวม*/
                    document.getElementById("<%=lblTotalAmount.ClientID%>").innerHTML = ''; /*ราคาสุทธิ*/
                }

                function addCommasAllLable() {
                    lblExcludeAmount.innerHTML = addCommas(lblExcludeAmount.innerHTML);
                    lblVatAmount.innerHTML = addCommas(lblVatAmount.innerHTML);
                    lblDiscountPercentAmount.innerHTML = addCommas(lblDiscountPercentAmount.innerHTML);
                    lblTotalDiscountAmount.innerHTML = addCommas(lblTotalDiscountAmount.innerHTML);
                    lblTotalAmount.innerHTML = addCommas(lblTotalAmount.innerHTML);
                }

                function addCommas(nStr) {
                    nStr += '';
                    x = nStr.split('.');
                    x1 = x[0];
                    x2 = x.length > 1 ? '.' + x[1] : '';
                    var rgx = /(\d+)(\d{3})/;
                    while (rgx.test(x1)) {
                        x1 = x1.replace(rgx, '$1' + ',' + '$2');
                    }
                    return x1 + x2;
                }

                function ChangeDurationRequire(durationRequire, dateRequire, datePicker) {
                    var panelDuration = document.getElementById(durationRequire);
                    var panelDate = document.getElementById(dateRequire);
                    var panelDatePicker = document.getElementById(datePicker);
                    panelDuration.style.visibility = "visible";
                    panelDate.style.visibility = "hidden";
                    panelDatePicker.style.visibility = "hidden";
                }

                function ChangeDateRequire(durationRequire, dateRequire, datePicker) {
                    var panelDuration = document.getElementById(durationRequire);
                    var panelDate = document.getElementById(dateRequire);
                    var panelDatePicker = document.getElementById(datePicker);
                    panelDuration.style.visibility = "hidden";
                    panelDate.style.visibility = "visible";
                    panelDatePicker.style.visibility = "visible";
                }
                
                Sys.Application.add_load(setCalendarTable);
                Sys.Application.add_load(setCalendarReqTable);
                
                function setCalendarTable() {
                    var tooltip = $find("<%= ToolTipDate.ClientID %>");
                    var calendar = $find("<%= CalendarDate.ClientID %>");                       
                    var fastNavigation = calendar._getFastNavigation();
                    fastNavigation.OnToday =
                    function()
                    {
                        var today = new Date;
                        var date = [today.getFullYear(), today.getMonth()+ 1, today.getDate()];
                        calendar.selectDate(date, true);
                        fastNavigation.Popup.Hide();  
                        var all_date = date.toString().split(",");
                        var year = parseInt(all_date[0]) + 543;
                        var month = all_date[1];
                        var day = all_date[2];
                        if (day.length == 1) {
                            day = '0' + day;
                        }
                        if (month.length == 1) {
                            month = '0' + month;
                        }

                        var maskText = $find("<%= txtDate.ClientID %>");
                        maskText.set_value(day + month + year);
                        tooltip.hide();
                    }
                }
                
                function setCalendarReqTable() {
                    var tooltip = $find("<%= ToolTipDateReq.ClientID %>");
                    var calendar = $find("<%= CalendarDateReq.ClientID %>");                       
                    var fastNavigation = calendar._getFastNavigation();
                    fastNavigation.OnToday =
                    function()
                    {
                        var today = new Date;
                        var date = [today.getFullYear(), today.getMonth()+ 1, today.getDate()];
                        calendar.selectDate(date, true);
                        fastNavigation.Popup.Hide();  
                        var all_date = date.toString().split(",");
                        var year = parseInt(all_date[0]) + 543;
                        var month = all_date[1];
                        var day = all_date[2];
                        if (day.length == 1) {
                            day = '0' + day;
                        }
                        if (month.length == 1) {
                            month = '0' + month;
                        }

                        var maskText = $find("<%= txtDateReq.ClientID %>");
                        maskText.set_value(day + month + year);
                        tooltip.hide();
                    }
                }

                function OnDateClick(calendarInstance, args) {
                    var tooltip = $find("<%= ToolTipDate.ClientID %>");
                    var fastNavigation = calendarInstance._getFastNavigation();
                    var date = args.get_renderDay().get_date().toString();
                    var all_date = date.split(",");
                    var year = parseInt(all_date[0]) + 543;
                    var month = all_date[1];
                    var day = all_date[2];
                    if (day.length == 1) {
                        day = '0' + day;
                    }
                    if (month.length == 1) {
                        month = '0' + month;
                    }

                    var maskText = $find("<%= txtDate.ClientID %>");
                    maskText.set_value(day + month + year);
                    tooltip.hide();
                }
                
                function OnDateReqClick(calendarInstance, args) {
                    var tooltip = $find("<%= ToolTipDateReq.ClientID %>");
                    var fastNavigation = calendarInstance._getFastNavigation();
                    var date = args.get_renderDay().get_date().toString();
                    var all_date = date.split(",");
                    var year = parseInt(all_date[0]) + 543;
                    var month = all_date[1];
                    var day = all_date[2];
                    if (day.length == 1) {
                        day = '0' + day;
                    }
                    if (month.length == 1) {
                        month = '0' + month;
                    }

                    var maskText = $find("<%= txtDateReq.ClientID %>");
                    maskText.set_value(day + month + year);
                    tooltip.hide();
                }
                
                function OnCalendarViewChanged(sender, step) {
                    var year = parseInt(sender.FocusedDate[0]) + 543;
                    var month = sender.FocusedDate[1];
                    document.getElementById("CalendarDate_Title").innerHTML = changeMonthNumberToName(month) + " " + year; 
                } 
                
                function OnCalendarReqViewChanged(sender, step) {
                    var year = parseInt(sender.FocusedDate[0]) + 543;
                    var month = sender.FocusedDate[1];
                    document.getElementById("CalendarDateReq_Title").innerHTML = changeMonthNumberToName(month) + " " + year; 
                } 
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager runat="server" ID="RadManager1" OnAjaxRequest="RadManager1_AjaxRequest">
            <AjaxSettings>
               <telerik:AjaxSetting AjaxControlID="nextButton_Detail">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="nextButton_Detail" />
                        <telerik:AjaxUpdatedControl ControlID="panel_Item" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panel_Item" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="nextButton_Item">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="nextButton_Item" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="backButton_Item">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="backButton_Item" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="panelCommand_Item">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panel_Item" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="panel_Hidden" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                 <telerik:AjaxSetting AjaxControlID="panelCommand_File">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panel_File" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    
        <asp:Panel ID="panelHidden" runat="server">
            <asp:HiddenField ID="hdSeq" runat="server" Value="" />
            <asp:HiddenField ID="hdSourceFile" runat="server" Value="" />
            <asp:HiddenField ID="hdDefaultVat" runat="server" Value="" />
            <asp:HiddenField ID="hdExcludeVatAmount" runat="server" Value="" />
            <asp:HiddenField ID="hdVatAmount" runat="server" Value="" />
            <asp:HiddenField ID="hdNetAmount" runat="server" Value="" />
            <asp:HiddenField ID="hdVatType" runat="server" Value="" />
            <asp:HiddenField ID="hdNewVatType" runat="server" Value="" />
            <asp:HiddenField ID="hdQuotationSeq" runat="server" Value="" />
        </asp:Panel>
        
        <asp:Panel ID="panelAll" runat="server">
            <div class="exampleWrapper">
                <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" Skin="Vista" CssClass="multiPage" OnClientTabSelecting="OnClientTabSelecting">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="ข้อมูลหลักผู้ขาย"  Value="Detail" Selected="true">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="รายการเสนอราคา"  Value="Item" >
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="เอกสารการเสนอราคา"  Value="File">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="pageView">
                    <telerik:RadPageView ID="RadPageView1" runat="server">
                        <asp:Panel ID="panel_Detail" runat="server">
                            <div class="bigModuleRight" align="left">
                                <div class="bigModuleBottomRight">
                                    <asp:Panel ID="panelHeaderList" runat="server">
                                        <div class="header-grid">
                                            <asp:Label ID="lblHeaderList" runat="server" Text="ข้อมูลหลักผู้ขาย"></asp:Label>
                                        </div>
                                    </asp:Panel>
                                    <asp:Panel CssClass="panelList" runat="server" ID="panelList" ScrollBars="Auto">
                                        <table width="98%">
                                            <tr>
                                                <td width="650px" valign="top">
                                                    <table>
                                                        <tr>
                                                            <td width="10px">
                                                            </td>
                                                            <td>
                                                                <div class="formList-detail">
                                                                    <table>
                                                                        <tr>
                                                                            <td width = "100px" valign="top">
                                                                                ผู้ขาย/รับจ้าง :
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadComboBox ID="cbSeller" runat="server" 
                                                                                    AllowCustomText="true" EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." 
                                                                                    EnableLoadOnDemand="true" EnableVirtualScrolling="true" Height="230px" 
                                                                                    HighlightTemplatedItems="true" MarkFirstMatch="false" 
                                                                                    OnClientTextChange="onTextChangeGeneral" 
                                                                                    OnItemsRequested="cbSeller_ItemsRequested" OnClientSelectedIndexChanged="cbSellerOnSelectedIndexChanged"
                                                                                    ShowDropDownOnTextboxClick="true" ShowMoreResultsBox="true" Width="440px">
                                                                                    <HeaderTemplate>
                                                                                        <table cellpadding="0" cellspacing="0" class="font-label">
                                                                                            <tr>
                                                                                                <td align="center" width="100px"><b>ประเภท</b></td>
                                                                                                <td align="center" width="100px"><b>รหัสผู้ขาย</b></td>
                                                                                                <td align="center" width="100px"><b>ชื่อผู้ขาย</b></td>
                                                                                                <td align="center" width="100px"><b>ที่อยู่</b></td>
                                                                                            </tr>
                                                                                        </table>
                                                                                    </HeaderTemplate>
                                                                                    <ItemTemplate>
                                                                                        <asp:Table ID="tableSeller" runat="server" CellPadding="0" CellSpacing="0" CssClass="font-label">
                                                                                        </asp:Table>
                                                                                    </ItemTemplate>
                                                                                </telerik:RadComboBox>
                                                                                &nbsp;<label id="Label14" runat="server"><font color="red">*</font></label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                            </td>
                                                                            <td>
                                                                                <asp:RequiredFieldValidator ID="ValcbSeller" runat="server" ControlToValidate="cbSeller" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุผู้ขาย/รับจ้าง *"></asp:RequiredFieldValidator>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                            </td>
                                                            <td>
                                                                <div class="formList-detail">
                                                                    <table>
                                                                        <tr>
                                                                            <td width = "100px">
                                                                                ฐานภาษี :
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadComboBox ID="cbVatType" runat="server" 
                                                                                    AllowCustomText="true" CssClass="RadComboBox" DataTextField="Name" 
                                                                                    DataValueField="Seq" EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." 
                                                                                    Filter="Contains" LoadingMessage="กำลังโหลดข้อมูล ..." MarkFirstMatch="false" 
                                                                                    OnClientTextChange="onTextChangeGeneral" ShowDropDownOnTextboxClick="true"
                                                                                    CausesValidation="false" AutoPostBack="False" OnClientSelectedIndexChanged="cbVatTypeOnSelectedIndexChanged">
                                                                                </telerik:RadComboBox>
                                                                                &nbsp;<label id="Label16" runat="server"><font color="red">*</font></label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                            </td>
                                                                            <td>
                                                                                <asp:RequiredFieldValidator ID="ValcbVatType" runat="server" ControlToValidate="cbVatType" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุฐานภาษี *"></asp:RequiredFieldValidator>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                            </td>
                                                            <td>
                                                                <div class="formList-detail">
                                                                    <table>
                                                                        <tr>
                                                                            <td width = "100px">
                                                                                อัตราภาษี :
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox ID="txtVatPercent" runat="server" NumberFormat-DecimalDigits="2" Skin="Outlook" Width="50px"></telerik:RadNumericTextBox> 
                                                                            </td>
                                                                            <td>
                                                                                &nbsp;<label id="Label8" runat="server">%</label>&nbsp;<label id="Label1" runat="server"><font color="red">*</font></label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                            </td>
                                                                            <td colspan="2">
                                                                                <asp:RequiredFieldValidator ID="ValtxtVatPercent" runat="server" ControlToValidate="txtVatPercent" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุอัตราภาษี *"></asp:RequiredFieldValidator>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                            </td>
                                                            <td>
                                                                <div class="formList-detail">
                                                                    <table>
                                                                        <tr>
                                                                            <td width = "100px" valign="top">
                                                                                วันที่เสนอราคา :
                                                                            </td>
                                                                            <td colspan="2">
                                                                                <telerik:RadMaskedTextBox ID="txtDate" runat="server" Mask=" ##/##/####" Width="75px" TextWithLiterals=" //" SelectionOnFocus="SelectAll"></telerik:RadMaskedTextBox>
                                                                                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="LinkButton">
                                                                                    <img alt="" src="../Image/Icon/Calendar.gif" style="border:0px;vertical-align:middle;" />
                                                                                </asp:LinkButton>
                                                                                <telerik:RadToolTip ID="ToolTipDate" runat="server" Animation="None" HideEvent="LeaveToolTip" Position="MiddleRight" ShowEvent="OnClick" Skin="Telerik" 
                                                                                TargetControlID="LinkButton1" Modal="true">
                                                                                    <telerik:RadCalendar id="CalendarDate" runat="server" TitleFormat="MMMM yyyy" EnableMultiSelect="false" UseRowHeadersAsSelectors="false" UseColumnHeadersAsSelectors="false" DayCellToolTipFormat="dddd, dd MMMM, yyyy" NavigationPrevToolTip="เดือนก่อนหน้า" NavigationNextToolTip="เดือนถัดไป" FastNavigationNextToolTip="3 เดือนถัดไป" FastNavigationPrevToolTip="3 เดือนก่อนหน้า">
                                                                                        <ClientEvents OnDateClick="OnDateClick" OnCalendarViewChanged="OnCalendarViewChanged"></ClientEvents>
                                                                                        <FastNavigationSettings EnableTodayButtonSelection="true" TodayButtonCaption="ไปที่วันนี้" OkButtonCaption="เปลี่ยน" CancelButtonCaption="ยกเลิก" />
                                                                                    </telerik:RadCalendar>
                                                                                </telerik:RadToolTip>
                                                                                &nbsp;<label id="Label2" runat="server"><font color="red">*</font></label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                            </td>
                                                                            <td colspan="2">
                                                                                <asp:CustomValidator ID="ValDate" runat="server" ErrorMessage="กรุณาระบุวันที่เสนอราคาให้ถูกต้อง" Display="Dynamic" ClientValidationFunction="validateDate" ControlToValidate="txtDate"></asp:CustomValidator>
                                                                                <asp:RequiredFieldValidator ID="RqValDate" runat="server" ControlToValidate="txtDate" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุวันที่เสนอราคา *"></asp:RequiredFieldValidator>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    <table width="100%" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td>
                                                                <table cellpadding="0" cellspacing="0" width="98%">
                                                                    <tr>
                                                                        <td width="15px">
                                                                        </td>
                                                                        <td>
                                                                            <table width="100%">
                                                                                <tr>
                                                                                    <td width="100px">
                                                                                        ระยะเวลาส่งมอบ :
                                                                                    </td>
                                                                                    <td width="70px">
                                                                                        <asp:RadioButton ID="rdbDuration" runat="server" Checked="true" GroupName="During" Text="ภายใน" />
                                                                                    </td>
                                                                                    <td>
                                                                                        <asp:Panel ID="panelDuration" runat="server">
                                                                                            <telerik:RadNumericTextBox ID="txtDurationReq" runat="server" NumberFormat-DecimalDigits="0" Skin="Outlook" Width="50px"></telerik:RadNumericTextBox> 
                                                                                            <telerik:RadComboBox ID="cbDurationType" runat="server" 
                                                                                                AllowCustomText="false" CssClass="RadComboBox" DataTextField="Name" 
                                                                                                DataValueField="Seq" Filter="Contains" MarkFirstMatch="false" 
                                                                                                OnClientTextChange="onTextChangeGeneral" ShowDropDownOnTextboxClick="true" 
                                                                                                Width="80px">
                                                                                            </telerik:RadComboBox>
                                                                                            &nbsp;<label id="Label6" runat="server"><font color="red">*</font></label>
                                                                                        </asp:Panel>  
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    <table width="100%" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td>
                                                                <table cellpadding="0" cellspacing="0" width="98%">
                                                                    <tr>
                                                                        <td width="15px">
                                                                        </td>
                                                                        <td>
                                                                            <div class="formList-detail">
                                                                                <table>
                                                                                    <tr>
                                                                                        <td width="100px">
                                                                                        </td>
                                                                                        <td>
                                                                                            <asp:RadioButton ID="rdbDate" runat="server" GroupName="During" Text="ภายในวันที่" />
                                                                                        </td>
                                                                                        <td>
                                                                                            <asp:Panel ID="panelDateReq" runat="server">
                                                                                                <telerik:RadMaskedTextBox ID="txtDateReq" runat="server" Mask=" ##/##/####" SelectionOnFocus="SelectAll" TextWithLiterals=" //" Width="75px">
                                                                                                </telerik:RadMaskedTextBox>
                                                                                            </asp:Panel>
                                                                                        </td>
                                                                                        <td>
                                                                                            <asp:Panel ID="panelDateReqPick" runat="server">
                                                                                                <asp:LinkButton ID="LinkButton2" runat="server" CssClass="LinkButton">
                                                                                                    <img alt="" src="../Image/Icon/Calendar.gif" style="border:0px;vertical-align:middle;" />
                                                                                                </asp:LinkButton>
                                                                                                <telerik:RadToolTip ID="ToolTipDateReq" runat="server" Animation="None" HideEvent="LeaveToolTip" Position="MiddleRight" ShowEvent="OnClick" Skin="Telerik" 
                                                                                                TargetControlID="LinkButton2" Modal="true">
                                                                                                    <telerik:RadCalendar id="CalendarDateReq" runat="server" TitleFormat="MMMM yyyy" EnableMultiSelect="false" UseRowHeadersAsSelectors="false" UseColumnHeadersAsSelectors="false" DayCellToolTipFormat="dddd, dd MMMM, yyyy" NavigationPrevToolTip="เดือนก่อนหน้า" NavigationNextToolTip="เดือนถัดไป" FastNavigationNextToolTip="3 เดือนถัดไป" FastNavigationPrevToolTip="3 เดือนก่อนหน้า">
                                                                                                        <ClientEvents OnDateClick="OnDateReqClick" OnCalendarViewChanged="OnCalendarReqViewChanged"></ClientEvents>
                                                                                                        <FastNavigationSettings EnableTodayButtonSelection="true" TodayButtonCaption="ไปที่วันนี้" OkButtonCaption="เปลี่ยน" CancelButtonCaption="ยกเลิก" />
                                                                                                    </telerik:RadCalendar>
                                                                                                </telerik:RadToolTip>
                                                                                                &nbsp;<label id="Label12" runat="server"><font color="red">*</font></label>
                                                                                            </asp:Panel>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td>
                                                                                        </td>
                                                                                        <td colspan="3">
                                                                                            <custom:MultipleFieldsValidator ID="ValRequire" runat="server" Display="Dynamic" ErrorMessage="* กรุณาระบุระยะเวลาส่งมอบ *" ControlsToValidate="txtDurationReq, txtDateReq" Condition="OR"></custom:MultipleFieldsValidator>
                                                                                            <asp:CustomValidator ID="ValDateReq" runat="server" ControlToValidate="txtDateReq" ClientValidationFunction="validateDate" Display="Dynamic" ErrorMessage="กรุณาระบุวันที่ให้ถูกต้อง"></asp:CustomValidator>
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </div>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </div>
                            </div>
                            <asp:Panel ID="panelTool_Detail" runat="server">
                                <div class="bigModuleRight">
                                    <div class="bigModuleBottomRight">
                                        <table width="100%">
                                            <tr class="command-list">
                                                <td align="right">
                                                    <td align="right">
                                                        <asp:LinkButton ID="nextButton_Detail" runat="server" OnClick="nextButton_Detail_Click" ValidationGroup="Test"> 
                                                            <img alt="" src="../Image/Button/next_button.png" style="border:0px;vertical-align:middle;" /> 
                                                        </asp:LinkButton>
                                                    </td>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>        
                            </asp:Panel>
                        </asp:Panel>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView2" runat="server">
                        <asp:Panel ID="panel_Item" runat="server">
                            <table style="width: 98%;" cellpadding="0" cellspacing="0">
                                <tr valign="top">
                                    <td valign="top">
                                        <asp:Panel ID="panelCommand_Item" runat="server">
                                            <div class="bigModuleRight">
                                                <div class="bigModuleBottomRight">
                                                    <table>
                                                        <tr class="command-list">
                                                            <td class="command-item" style="border: none">
                                                                <asp:LinkButton ID="ShowGrid_Item" runat="server" CssClass="LinkButton" onclick="ShowGrid_Item_Click" CausesValidation="false">
                                                                    <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;แสดงข้อมูลทั้งหมด
                                                                </asp:LinkButton>                        
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="AddNew_Item" runat="server" CssClass="LinkButton" onclick="AddNew_Item_Click">
                                                                    <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/AddRecord.gif" />&nbsp;&nbsp;เพิ่มข้อมูลใหม่
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="Edit_Item" runat="server" CssClass="LinkButton"  visible="false" OnClick="Edit_Item_Click">
                                                                    <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Edit.gif" />&nbsp;&nbsp;แก้ไขข้อมูล
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="Delete_Item" runat="server" CssClass="LinkButton" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')" OnClick="Delete_Item_Click">
                                                                    <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Delete.gif" />&nbsp;&nbsp;ลบข้อมูล
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="AddNewSave_Item" runat="server" CssClass="LinkButton" Visible="false" onclick="AddNewSave_Item_Click" ValidationGroup="Item">
                                                                    <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="EditSave_Item" runat="server" CssClass="LinkButton" Visible="false" onclick="EditSave_Item_Click">
                                                                    <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="Cancel_Item" runat="server" CssClass="LinkButton" Visible="false" onclick="Cancel_Item_Click">
                                                                    <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cancel.gif" />&nbsp;&nbsp;ยกเลิก
                                                                </asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>        
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Panel ID="panelData_Item" runat="server">
                                            <div class="bigModuleRight">
                                                <div class="bigModuleBottomRight">
                                                    <asp:Panel ID="panelHeaderList1" runat="server">
                                                        <div class="header-grid">
                                                            <asp:Label ID="Label3" runat="server" Text="ข้อมูลรายการเสนอราคา"></asp:Label>
                                                        </div>
                                                    </asp:Panel>
                                                    <asp:Panel CssClass="panelList" runat="server" ID="panelList_Item" ScrollBars="Vertical" Visible="false">
                                                        <table width="98%">
                                                            <tr>
                                                                <td width="650px" valign="top">
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td colspan="3">
                                                                                <div class="formList-detail">
                                                                                    <table width="100%">
                                                                                        <tr>
                                                                                            <td width="80px" valign="top">
                                                                                                รายการพัสดุ :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblItem" runat="server"></asp:Label>
                                                                                                <telerik:RadComboBox ID="cbItem" runat="server" 
                                                                                                    AllowCustomText="true" EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." 
                                                                                                    EnableLoadOnDemand="true" EnableVirtualScrolling="true" Height="230px" 
                                                                                                    HighlightTemplatedItems="true" MarkFirstMatch="false" 
                                                                                                    OnClientTextChange="onTextChangeGeneral" 
                                                                                                    OnItemsRequested="cbItem_ItemsRequested" 
                                                                                                    ShowDropDownOnTextboxClick="true" ShowMoreResultsBox="true" Width="440px" 
                                                                                                    OnClientSelectedIndexChanged="cbItemOnSelectedIndexChanged">
                                                                                                    <HeaderTemplate>
                                                                                                        <table cellpadding="0" cellspacing="0" class="font-label">
                                                                                                            <tr>
                                                                                                                <td align="center" width="100px"><b>รายการพัสดุ</b></td>
                                                                                                                <td align="center" width="100px"><b>รายละเอียด</b></td>
                                                                                                                <td align="center" width="50px"><b>จำนวน</b></td>
                                                                                                                <td align="center" width="50px"><b>หน่วย</b></td>
                                                                                                                <td align="center" width="100px"><b>ราคา<br />ต่อหน่วย(บาท)</b></td>
                                                                                                            </tr>
                                                                                                        </table>
                                                                                                    </HeaderTemplate>
                                                                                                    <ItemTemplate>
                                                                                                        <asp:Table ID="tableItem" runat="server" CellPadding="0" CellSpacing="0" CssClass="font-label">
                                                                                                        </asp:Table>
                                                                                                    </ItemTemplate>
                                                                                                </telerik:RadComboBox>
                                                                                                &nbsp;<label id="Label4" runat="server"><font color="red">*</font></label>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Panel ID="panelValcbItem" runat="server">
                                                                                                </asp:Panel>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                            </td>
                                                                            <td colspan="3">
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="80px" valign="top">
                                                                                                รายละเอียด :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblItemDescr" runat="server" AssociatedControlID="txtItemDescr"></asp:Label>
                                                                                                <asp:TextBox ID="txtItemDescr" runat="server" CssClass="TextBox" Width="440px" Height="100px" TextMode="MultiLine"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="80px">
                                                                                                จำนวน :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblItemQty" runat="server" AssociatedControlID="txtItemQty"></asp:Label>
                                                                                                <telerik:RadNumericTextBox ID="txtItemQty" runat="server" NumberFormat-DecimalDigits="0" Skin="Outlook" Width="70px" onBlur="CalculateVat()"></telerik:RadNumericTextBox> 
                                                                                                &nbsp;<asp:Label ID="lblUnit" runat="server"></asp:Label>
                                                                                                &nbsp;<label id="Label5" runat="server"><font color="red">*</font></label>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Panel ID="panelValtxtItemQty" runat="server">
                                                                                                </asp:Panel>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="90px">
                                                                                                ราคาต่อหน่วย :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblItemPrice" runat="server" AssociatedControlID="txtItemPrice"></asp:Label>
                                                                                                <telerik:RadNumericTextBox ID="txtItemPrice" runat="server" NumberFormat-DecimalDigits="2" Skin="Outlook" Width="100px" onBlur="CalculateVat()"></telerik:RadNumericTextBox> 
                                                                                                &nbsp;บาท&nbsp;<label id="Label7" runat="server"><font color="red">*</font></label>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Panel ID="panelValtxtItemPrice" runat="server">
                                                                                                </asp:Panel>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="80px">
                                                                                                ฐานภาษี :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblVatTypeName" runat="server" text="แยกภาษี"></asp:Label>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="90px">
                                                                                                ราคาไม่รวมภาษี :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblExcludeAmount" runat="server"></asp:Label>
                                                                                                &nbsp;บาท
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="80px">
                                                                                                ภาษี :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblVatPercent" runat="server" text="7"></asp:Label>
                                                                                                &nbsp;%
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="90px">
                                                                                                ภาษีมูลค่าเพิ่ม :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblVatAmount" runat="server"></asp:Label>
                                                                                                &nbsp;บาท
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="80px">
                                                                                                อัตราส่วนลด :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblDiscountPercent" runat="server" AssociatedControlID="txtDiscountPercent"></asp:Label>
                                                                                                <telerik:RadNumericTextBox ID="txtDiscountPercent" runat="server" NumberFormat-DecimalDigits="0" Skin="Outlook" Width="100px" onBlur="CalculateVat()"></telerik:RadNumericTextBox> 
                                                                                                &nbsp;%
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="90px">
                                                                                                คิดเป็นมูลค่า :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblDiscountPercentAmount" runat="server"></asp:Label>
                                                                                                &nbsp;บาท
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="80px">
                                                                                                ส่วนลดพิเศษ :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblExtraDiscount" runat="server" AssociatedControlID="txtExtraDiscount"></asp:Label>
                                                                                                <telerik:RadNumericTextBox ID="txtExtraDiscount" runat="server" NumberFormat-DecimalDigits="0" Skin="Outlook" Width="100px" onBlur="CalculateVat()"></telerik:RadNumericTextBox> 
                                                                                                &nbsp;บาท
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="90px">
                                                                                                มูลค่าส่วนลดรวม :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblTotalDiscountAmount" runat="server"></asp:Label>
                                                                                                &nbsp;บาท
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td>
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="80px" valign="top">
                                                                                                หมายเหตุ :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblRemark" runat="server" AssociatedControlID="txtRemark"></asp:Label>
                                                                                                <asp:TextBox ID="txtRemark" runat="server" Width="170px" Height="60px" TextMode="MultiLine"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                            <td width="10px">
                                                                            </td>
                                                                            <td valign="top">
                                                                                <div class="formList-detail">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td width="90px" valign="top">
                                                                                                ราคาสุทธิ :
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="lblTotalAmount" runat="server"></asp:Label>
                                                                                                &nbsp;บาท
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </asp:Panel>
                                                    <asp:Panel CssClass="panelGrid" ID="panelGrid_Item" runat="server" ScrollBars="Vertical" Visible="true">
                                                        <div align="center">
                                                            <telerik:RadGrid CssClass="RadGrid" ID="Grid_Item" runat="server" AllowFilteringByColumn="true"
                                                            AllowMultiRowSelection="True" AllowPaging="false" AllowSorting="True"
                                                            AutoGenerateColumns="False" EnableAJAX="True" ShowFooter="true"
                                                            GridLines="None" ShowStatusBar="false" Skin="Outlook" Width="95%"
                                                            OnItemCommand="Grid_Item_ItemCommand" OnItemDataBound="Grid_Item_ItemDataBound">
                                                                <MasterTableView GroupLoadMode="Client" AllowMultiColumnSorting="true" Width="100%" NoMasterRecordsText="<div align=center><font color=gray><i>ไม่มีข้อมูล</i></font></div>">
                                                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                                    <Columns>
                                                                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                                                                            <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                                                            <ItemStyle HorizontalAlign="Center" />
                                                                        </telerik:GridClientSelectColumn>
                                                                        <telerik:GridTemplateColumn DataField="InfoPrItem.ItemName"  HeaderText="รายการพัสดุ"
                                                                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                            FilterControlWidth="100%" UniqueName="InfoPrItem.ItemName" SortExpression="InfoPrItem.ItemName">
                                                                            <HeaderStyle HorizontalAlign="Center" />
                                                                            <ItemStyle HorizontalAlign="Left" />
                                                                            <ItemTemplate>
                                                                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#" onclick='<%# Eval("infoPrItem.Seq","return SeqClick( {0} );") %>' Text='<%# Eval("InfoPrItem.ItemName") %>'></asp:HyperLink>
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>
                                                                        <telerik:GridBoundColumn DataField="Descr" 
                                                                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                            FilterControlWidth="100%" SortExpression="Descr"
                                                                            HeaderStyle-HorizontalAlign="Center" HeaderText="รายละเอียด" 
                                                                            UniqueName="Descr">
                                                                            <HeaderStyle HorizontalAlign="Center" />
                                                                            <ItemStyle HorizontalAlign="Left" />
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="Qty" 
                                                                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                            FilterControlWidth="100%" SortExpression="Qty"
                                                                            HeaderStyle-HorizontalAlign="Center" HeaderText="จำนวน" 
                                                                            UniqueName="Qty" DataFormatString="{0:#,##0}">
                                                                            <HeaderStyle HorizontalAlign="Center" Width="80px"  />
                                                                            <ItemStyle HorizontalAlign="Right" />
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="InfoPrItem.InfoItem.InfoUnit.Name" 
                                                                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                            FilterControlWidth="100%" SortExpression="InfoPrItem.InfoItem.InfoUnit.Name"
                                                                            HeaderStyle-HorizontalAlign="Center" HeaderText="หน่วย" 
                                                                            UniqueName="InfoPrItem.InfoItem.InfoUnit.Name">
                                                                            <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                                                            <ItemStyle HorizontalAlign="Left" />
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridTemplateColumn AutoPostBackOnFilter="true" 
                                                                            CurrentFilterFunction="Contains" DataField="NetAmount" FilterControlWidth="100%" 
                                                                            HeaderText="ราคารวม(บาท)" ShowFilterIcon="false" 
                                                                            UniqueName="NetAmount" SortExpression="NetAmount">
                                                                            <ItemTemplate> 
                                                                                <asp:Label ID="lblNetAmount" runat="server" Text='<%# Eval("NetAmount", "{0:N2}") %>'> </asp:Label> 
                                                                            </ItemTemplate>
                                                                            <HeaderStyle HorizontalAlign="Center" />
                                                                            <ItemStyle HorizontalAlign="Right" />
                                                                            <FooterStyle HorizontalAlign="Right" />
                                                                            <FooterTemplate>
                                                                                <asp:Label ID="lblTotalPrice" runat="server" CssClass="font-label" Font-Bold="true" Width="100px"> </asp:Label>
                                                                            </FooterTemplate>
                                                                        </telerik:GridTemplateColumn>
                                                                        <telerik:GridBoundColumn DataField="Seq" 
                                                                            HeaderStyle-HorizontalAlign="Center" UniqueName="Seq" Visible="false">
                                                                            <HeaderStyle HorizontalAlign="Center" />
                                                                        </telerik:GridBoundColumn>
                                                                    </Columns>
                                                                </MasterTableView>
                                                                <ClientSettings EnableRowHoverStyle="true" >
                                                                    <Selecting AllowRowSelect="True" />
                                                                </ClientSettings>
                                                            </telerik:RadGrid>
                                                        </div>
                                                        <br />
                                                    </asp:Panel>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                        <asp:Panel ID="panelTool_Item" runat="server">
                                            <div class="bigModuleRight">
                                                <div class="bigModuleBottomRight">
                                                    <table width="100%">
                                                        <tr class="command-list">
                                                            <td align="left">
                                                                <asp:LinkButton ID="backButton_Item" runat="server" CausesValidation="false" OnClick="backButton_Item_Click"> 
                                                                    <img alt="" src="../Image/Button/back_button.png" style="border:0px;vertical-align:middle;" /> 
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td align="right">
                                                                <asp:LinkButton ID="nextButton_Item" runat="server" CausesValidation="false" OnClick="nextButton_Item_Click"> 
                                                                    <img alt="" src="../Image/Button/next_button.png" style="border:0px;vertical-align:middle;" /> 
                                                                </asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>        
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView3" runat="server">
                        <asp:Panel ID="panel_File" runat="server">
                            <table cellpadding="0" cellspacing="0" style="width: 98%;">
                                <tr valign="top">
                                    <td valign="top">
                                        <asp:Panel ID="panelCommand_File" runat="server">
                                            <div class="bigModuleRight">
                                                <div class="bigModuleBottomRight">
                                                    <table>
                                                        <tr class="command-list">
                                                            <td class="command-item" style="border: none">
                                                                <asp:LinkButton ID="ShowGrid_File" runat="server" CausesValidation="false" 
                                                                    CssClass="LinkButton" OnClick="ShowGrid_File_Click"> <img alt="" 
                                                                    src="../Image/Grid/table.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;แสดงข้อมูลทั้งหมด </asp:LinkButton>                        
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="AddNew_File" runat="server" CausesValidation="false" 
                                                                    CssClass="LinkButton" OnClick="AddNew_File_Click"> <img alt="" 
                                                                    src="../Image/Grid/AddRecord.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;เพิ่มข้อมูลใหม่ </asp:LinkButton>
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="AddNewSave_File" runat="server" CssClass="LinkButton" 
                                                                    OnClick="AddNewSave_File_Click" Visible="false"> <img alt="" 
                                                                    src="../Image/Grid/Cmd_Save.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;บันทึกข้อมูล </asp:LinkButton>
                                                            </td>
                                                            <td class="command-item">
                                                                <asp:LinkButton ID="Delete_File" runat="server" CausesValidation="false" 
                                                                    CssClass="LinkButton" OnClick="Delete_File_Click" 
                                                                    OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')"> <img 
                                                                    alt="" src="../Image/Grid/Delete.gif" 
                                                                    style="border:0px;vertical-align:middle;" />&#160;&#160;ลบข้อมูล </asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>        
                                        </asp:Panel>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Panel ID="panelData_File" runat="server">
                                            <div class="bigModuleRight">
                                                <div class="bigModuleBottomRight">
                                                    <asp:Panel ID="panelHeaderList4" runat="server">
                                                        <div class="header-grid">
                                                            <asp:Label ID="Label9" runat="server" Text="ข้อมูลเอกสารแนบ"></asp:Label>
                                                        </div>
                                                    </asp:Panel>
                                                    <asp:Panel ID="panelList_File" runat="server" CssClass="panelList" ScrollBars="Auto" Visible="false">
                                                        <table cellpadding="0" cellspacing="0" width="98%">
                                                            <tr>
                                                                <td width="30px">
                                                                </td>
                                                                <td>
                                                                    <div class="formList-detail">
                                                                        <table>
                                                                            <tr>
                                                                                <td valign="top" width="50px">
                                                                                    ชื่อไฟล์ :
                                                                                </td>
                                                                                <td>
                                                                                    <asp:TextBox ID="txtFileName" runat="server" Width="470px"></asp:TextBox>
                                                                                    &#160;<label id="Label10" runat="server"><font color="red">*</font></label>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                </td>
                                                                                <td>
                                                                                    <asp:Panel ID="panelValtxtFileName" runat="server">
                                                                                    </asp:Panel>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td width="30px">
                                                                </td>
                                                                <td>
                                                                    <div class="formList-detail">
                                                                        <table>
                                                                            <tr>
                                                                                <td valign="top" width="50px">
                                                                                    ที่อยู่ไฟล์ :
                                                                                </td>
                                                                                <td>
                                                                                    <div id="uploadFile_div" runat="server">
                                                                                        <input id="attachment" runat="server" name="attachment" 
                                                                                            onchange="getSourceFile();" onkeydown="return false;" size="60" type="file" />
                                                                                        &#160;<label id="Label11" runat="server"><font color="red">*</font></label>
                                                                                    </div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                </td>
                                                                                <td>
                                                                                    <asp:Panel ID="panelValattachment" runat="server">
                                                                                    </asp:Panel>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </asp:Panel>
                                                    <asp:Panel ID="panelGrid_File" runat="server" CssClass="panelGrid" ScrollBars="Auto">
                                                        <div align="left">
                                                            <telerik:RadGrid ID="Grid_File" runat="server" AllowFilteringByColumn="true" 
                                                                AllowMultiRowSelection="True" AllowPaging="false" AllowSorting="True" 
                                                                AutoGenerateColumns="False" CssClass="RadGrid" EnableAJAX="True" 
                                                                GridLines="None" OnItemCommand="Grid_File_ItemCommand" ShowStatusBar="false" 
                                                                Skin="Outlook" Width="95%">
                                                                <MasterTableView GroupLoadMode="Client" AllowMultiColumnSorting="true" Width="100%" NoMasterRecordsText="<div align=center><font color=gray><i>ไม่มีข้อมูล</i></font></div>">
                                                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                                    <Columns>
                                                                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                                                                            <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                                                            <ItemStyle HorizontalAlign="Center" />
                                                                        </telerik:GridClientSelectColumn>
                                                                        <telerik:GridTemplateColumn DataField="Name"  HeaderText="ชื่อไฟล์"
                                                                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                            FilterControlWidth="100%" UniqueName="Name" SortExpression="Name">
                                                                            <HeaderStyle HorizontalAlign="Center" />
                                                                            <ItemStyle HorizontalAlign="Left" />
                                                                            <ItemTemplate>
                                                                                <asp:HyperLink ID="lkName" runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# "../Form/Sys_File_View.aspx?table=icm_bidder_file&field=icm_bidder_file_seq&ex=" + Eval("Extension") + "&name=" + Eval("Name") + "&content=" + Eval("Content_type") + "&seq=" + Eval("Seq") %>' Target="_blank"></asp:HyperLink>
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>
                                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                            CurrentFilterFunction="Contains" DataField="File_Info.Extension" 
                                                                            FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                                                            HeaderText="นามสกุลไฟล์" ShowFilterIcon="false" UniqueName="FileInfo.Extension">
                                                                            <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                                            <ItemStyle HorizontalAlign="Center" />
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="Dest_path" 
                                                                            HeaderStyle-HorizontalAlign="Center" UniqueName="Dest_path" Visible="false">
                                                                            <HeaderStyle HorizontalAlign="Center" />
                                                                        </telerik:GridBoundColumn>
                                                                    </Columns>
                                                                </mastertableview>
                                                                <clientsettings enablerowhoverstyle="true">
                                                                    <selecting allowrowselect="True" />
                                                                </clientsettings>
                                                            </telerik:RadGrid>
                                                        </div>
                                                        <br />
                                                    </asp:Panel>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                        <asp:Panel ID="panelTool_File" runat="server">
                                            <div class="bigModuleRight">
                                                <div class="bigModuleBottomRight">
                                                    <table width="100%">
                                                        <tr class="command-list">
                                                            <td align="left">
                                                                <asp:LinkButton ID="backButton_File" runat="server" OnClick="backButton_File_Click"> 
                                                                    <img alt="" src="../Image/Button/back_button.png" style="border:0px;vertical-align:middle;" /> 
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td align="right">
                                                                <asp:LinkButton ID="finishButton_File" runat="server" OnClick="finishButton_File_Click" OnClientClick="javascript:return confirm('ยืนยันการบันทึกข้อมูล');"> 
                                                                    <img alt="" src="../Image/Button/finish_button.png" style="border:0px;vertical-align:middle;" /> 
                                                                </asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>        
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
            </div>
        </asp:Panel>
    </form>
</body>
</html>